import React, { Component } from 'react'

export default class Test extends Component {
    constructor(props){
        super(props)
    }

    add =()=>{
        this.props.store.dispatch({type:'add'})
        console.log(this.props.store.getState());
    }

    render() {
        let state = this.props.store.getState();
        return (
            <div>
                <h2>我是Test组件</h2>
                <h3>{state.count}</h3>
                <button onClick={this.add}>+</button>
            </div>
        )
    }
}